package com.lframework.xingyun.basedata.vo.product.info;

import com.lframework.starter.web.core.vo.BaseVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

@Data
public class ProductSpecSaveVo implements BaseVo, Serializable {

    /**
     * 商品规格id
     */
    @ApiModelProperty(value = "商品规格id")
    private String specId;

    @NotBlank(message = "请输入库存单位！")
    @ApiModelProperty(value = "商品规格名称")
    private String spec;

    @NotBlank(message = "请输入库存单位！")
    @ApiModelProperty(value = "SKU编码")
    private String skuCode;

    @NotNull(message = "请输入采购价！")
    @ApiModelProperty(value = "采购价", required = true)
    private BigDecimal purchasePrice;

    @NotNull(message = "请输入零售价！")
    @ApiModelProperty(value = "零售价", required = true)
    private BigDecimal retailPrice;

    @NotNull(message = "请输入销售价！")
    @ApiModelProperty(value = "销售价", required = true)
    private BigDecimal salePrice;

    @ApiModelProperty(value = "重量")
    private BigDecimal weight;

    @ApiModelProperty(value = "体积")
    private BigDecimal volume;

    @ApiModelProperty(value = "是否可用")
    private Boolean available;

    @ApiModelProperty(value = "属性值组合id")
    private String validPropertyValues;

    @NotNull(message = "请输入属性列表！")
    @ApiModelProperty(value = "属性列表", required = true)
    private List<PropertyVo> property;

    @Data
    public static class PropertyVo {
        /**
         * 属性id
         */
        @ApiModelProperty(value = "属性id", required = true)
        @NotBlank(message = "请输入属性id！")
        private String propertyId;

        /**
         * 属性值Id
         */
        @ApiModelProperty(value = "属性值Id", required = true)
        @NotBlank(message = "请输入属性值Id！")
        private String propertyItemId;
    }
}
